package com.monkey4cloud.demo;

import java.util.stream.IntStream;

public class LambdaDemoApp {
    public static void main(String[] args) {
        int[] nums = {1, 2, 3, 4, 5, -1, 2, 3 - 1, -5, 8};
        int min = Integer.MAX_VALUE;
        for (int i : nums) {
            if (i < min) {
                min = i;
            }
        }
        System.out.println(min);

        int min2 = IntStream.of(nums).parallel().min().getAsInt();
        System.out.println(min2);
    }
}
